<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "get".
 *
 * @property integer $id
 * @property string $name
 * @property string $class
 * @property integer $time
 * @property string $place
 * @property string $xueyuan
 * @property string $xuanshang
 * @property string $person
 * @property string $tel
 * @property string $qq
 * @property string $more
 * @property integer $able
 * @property integer $users_id
 *
 * @property Users $users
 * @property GetHint[] $getHints
 */
class Get extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'get';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [[ 'name','class', 'time', 'place', 'xueyuan', 'xuanshang', 'person', 'tel', 'users_id',"publish_time"], 'required'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'class' => 'Class',
            'time' => 'Time',
            'place' => 'Place',
            'xueyuan' => 'Xueyuan',
            'xuanshang' => 'Xuanshang',
            'person' => 'Person',
            'tel' => 'Tel',
            'qq' => 'Qq',
            'more' => 'More',
            'able' => 'Able',
            'users_id' => 'Users ID',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUsers()
    {
        return $this->hasOne(Users::className(), ['id' => 'users_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getGetHints()
    {
        return $this->hasMany(GetHint::className(), ['get_id1' => 'id']);
    }
}
